/**
 * 登录模块接口列表
 */
import axios from "../../http/axios"; // 导入接口域名列表
import base from "../base";

const mearsuringPointSetting = {
  // 获取所有桥梁列表
  getBridgeAll() {
    return axios.get(`${base.baseUrl}/bridge_basic/queryBridgeBasicList`);
    // return axios.get(`${base.baseUrl}/bridge_basic/queryBridgeListByAppKey`);
  },
  // 获取存在病害的桥梁
  getDiseaseBridge() {
    return axios.get(
      `${base.inspUrl}/insp/statistics/bridge/queryBridgeIdsByToken`
    );
  },

  // 获取首页大屏告警列表 (最新十条数据) /health_monitoring/alarm/queryAlarmsByToken
  getWarnignList() {
    return axios.get(
      `${base.baseUrl}/health_monitoring/alarm/queryAlarmsByToken`
    );
  },

  // 获取测点管理资源树  /bridge_structure/queryConstructionModelTreeById  queryBridgeConstructionModelTreeById
  getPointTree(params = {}) {
    return axios.get(
      `${base.baseUrl}/bridge_basic/queryBridgeConstructionModelTreeById`,
      {
        params: params,
      }
    );
  },
  // 测点管理第二棵树 tree
  getPointNextTree(params = {}) {
    return axios.get(`${base.baseUrl}/bridge_component/queryBridgeComponents`, {
      params: params,
    });
  },

  // 查询部件下的 测点列表 /device_measure_point/queryAllDeviceMeasurePointByBridgeIdAndStructureId
  getPointList(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_point/queryAllDeviceMeasurePointByBridgeIdAndStructureId`,
      {
        params: params,
      }
    );
  },
  // 新增测点
  addPoint(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_measure_point/addDeviceMeasurePoint`,
      params
    );
  },
  // 更新测点 /device_measure_point/updateDeviceMeasurePoint
  uupdatePoint(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_measure_point/updateDeviceMeasurePoint`,
      params
    );
  },
  // 查询单个桥梁所有测点
  getBridgePointList(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_point/queryAllDeviceMeasurePointByBridgeId`,
      {
        params: params,
      }
    );
  },
  // 删除测点
  deletePoint(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_point/deleteDeviceMeasurePointById`,
      {
        params: params,
      }
    );
  },
  // 查询所有传感器设备     /device_sensor/queryAllDeviceSensorByBridgeId
  getDevice(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_sensor/queryAllDeviceSensorByBridgeId`,
      {
        params: params,
      }
    );
  },
  // 查询所有截面
  getBridgeCrossSections(params = {}) {
    return axios.get(
      `${base.baseUrl}/bridge_cross_section/queryBridgeCrossSections`,
      {
        params: params,
      }
    );
  },
  // 测点查测项 /device_measure_project/queryAllDeviceMeasureProjectByMeasurePointId
  getPointItems(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_project/queryAllDeviceMeasureProjectByMeasurePointId`,
      {
        params: params,
      }
    );
  },
  // 新增测项
  addPointItems(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_measure_project/addDeviceMeasureProject`,
      params
    );
  },
  // 修改测项  /device_measure_project/updateDeviceMeasureProject
  updatePointItems(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_measure_project/updateDeviceMeasureProject`,
      params
    );
  },
  // 删除测项   /device_measure_project/deleteDeviceMeasureProjectById
  deletePointItems(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_project/deleteDeviceMeasureProjectById`,
      {
        params: params,
      }
    );
  },

  // 获取一级分类
  getFirstType(params = {}) {
    return axios.get(
      `${base.baseUrl}/system_datatype/queryAllFirstSystemDataType`,
      {
        params: params,
      }
    );
  },
  // 获取二级分类   parentId
  getSecondType(params = {}) {
    return axios.get(
      `${base.baseUrl}/system_datatype/queryAllSystemDataTypeByParentId`,
      {
        params: params,
      }
    );
  },
  // 二级分类查询所有的点  /device_measure_point/queryAllDeviceMeasurePointBySecondTypeId
  getSecondTypePoint(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_point/queryAllDeviceMeasurePointBySecondTypeId`,
      {
        params: params,
      }
    );
  },
  // 新增告警信息
  setWarning(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_alarmthreshold/addDeviceAlarmThreshold`,
      params
    );
  },
  // 更新 告警  /device_alarmthreshold/updataDeviceAlarmThreshold
  updateWarning(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_alarmthreshold/updataDeviceAlarmThreshold`,
      params
    );
  },
  // 测点 id 查报警信息  /device_alarmthreshold/queryDeviceAlarmThreshold
  getWarning(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_alarmthreshold/queryDeviceAlarmThreshold`,
      {
        params: params,
      }
    );
  },

  // /////////////////////////////////////////////////////////////////
  // 获取桥梁下的立面 /bridge_facade/queryAllBridgeFacade
  getFacade(params = {}) {
    return axios.get(
      `${base.baseUrl}/bridge_facade/queryAllBridgeFacadeByBridgeId`,
      {
        params: params,
      }
    );
  },
  // 截面查询测点  /device_measure_point/queryAllDeviceMeasurePointByBridgeIdAndCrossSectionId
  getFacadePoint(params = {}) {
    return axios.get(
      `${base.baseUrl}/bridge_cross_section/queryBridgeCrossSectionById`,
      {
        params: params,
      }
    );
  },

  // 测点 id 查测传感器
  getDeviceSensor(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_sensor/queryDeviceSensorByMeasurePointId`,
      {
        params: params,
      }
    );
  },
  // 测点 id 查测点 /device_measure_point/queryDeviceMeasurePointById
  getPointDetail(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_measure_point/queryDeviceMeasurePointById`,
      {
        params: params,
      }
    );
  },

  // 获取实时数据 /health_monitoring/queryRealDataBySensorId
  getRealData(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryRealDataBySensorId`,
      {
        params: params,
      },
      {
        onTimeout: request => {
          console.log("1111111请求超时了！！！！！");
        },
      }
    );
  },
  // 历史数据
  getHistoryData(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryHistoryDataBySensorId`,
      {
        params: params,
      }
    );
  },
  // 超限数据 /health_monitoring/queryOverrunDataBySensorId
  getOverrunData(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryOverrunDataBySensorId`,
      {
        params: params,
      }
    );
  },

  // 整体监测大桥总览数据 /health_monitoring/queryPointNumberByBridgeId
  getBridgeData(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryPointNumberByBridgeId`,
      {
        params: params,
      }
    );
  },

  // 整体监测 -- card 数据  /health_monitoring/queryMeasurePointData
  getCard(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryMeasurePointData`,
      {
        params: params,
      }
    );
  },

  /**
   * 首页统计 api
   */
  // 获取桥梁分类统计
  getHomeBridgeAll(params = {}) {
    return axios.get(`${base.baseUrl}/bridge_type/queryBridgeTypeCount`, {
      params: params,
    });
  },

  // 获取桥梁总数
  getHomeBridgeNumber() {
    return axios.get(`${base.baseUrl}/bridge_basic/countBridgeNumberByAppKey`);
  },

  // 养护类型统计 /bridge_basic/queryMaintenanceTypeAllBridge
  getHomeBridgeType() {
    return axios.get(
      `${base.baseUrl}/bridge_basic/queryMaintenanceTypeAllBridge`
    );
  },

  // 技术评定情况 /bridge_basic/queryMaintenanceLevelAllBridge
  getHomeQk() {
    return axios.get(
      `${base.baseUrl}/bridge_basic/queryMaintenanceLevelAllBridge`
    );
  },

  // 病害处理情况 /insp/report/countStatus?status=2&&ownId=sdsdfsdf
  getHomeBh(params = {}) {
    return axios.get(`${base.inspUrl}/insp/report/countStatus`, {
      params: params,
    });
  },

  // 获取所有告警信息 /health_monitoring/queryCountByBridgeId
  getHomeWarning(params = {}) {
    return axios.get(`${base.baseUrl}/health_monitoring/queryCountByBridgeId`, {
      params: params,
    });
  },

  // 获取巡检 病害 养护总数 /maintenance/bridge/queryCount
  getHomeInsp(params = {}) {
    return axios.get(`${base.curingUrl}/maintenance/bridge/queryCount`, {
      params: params,
    });
  },
  // 病害分类统计 /insp/report/problem/class-statistic
  getHomePro(id) {
    return axios.get(
      `${base.inspUrl}/insp/report/problem/class-statistic?type=${id}`
    );
  },

  // 根据桥梁id 立面 id 查询 截面 /bridge_cross_section/queryCrossSectionByBridgeIdAndTypeId
  getGm(params = {}) {
    return axios.post(
      `${base.baseUrl}/bridge_cross_section/queryCrossSectionByBridgeIdAndTypeId`,
      params
    );
  },
  // 根据桥梁id 立面id 查询 测点数据 /device_measure_point/queryPointByCrossSectionIdAndTypeId
  getCd(params = {}) {
    return axios.post(
      `${base.baseUrl}/device_measure_point/queryPointByCrossSectionIdAndTypeId`,
      params
    );
  },

  // 获取告警 阈值  http://59.111.56.96:38084/sbm-srv/device_alarmthreshold/queryDeviceAlarmThreshold?measurePointId=778301337937903616
  getWarningLine(params = {}) {
    return axios.get(
      `${base.baseUrl}/device_alarmthreshold/queryDeviceAlarmThreshold`,
      {
        params: params,
      }
    );
  },

  // 根据测点id 查询病害  /health_monitoring/queryMeasurePointDisease
  getBH(params = {}) {
    return axios.get(
      `${base.baseUrl}/health_monitoring/queryMeasurePointDisease`,
      {
        params: params,
      }
    );
  },
};

export default mearsuringPointSetting;
